package cn.ssm.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import cn.ssm.pojo.Repairlist;
import cn.ssm.query.RepairCountQuery;
import cn.ssm.query.RepairlistQuery;

@Repository("RepairlistMapper")
public interface RepairlistMapper {

	public List<Repairlist> selRepairlist();

	public Repairlist selRepairlistId(@Param("id") int id);

	public List<Repairlist> selRepairlistAllByComputerroomId(@Param("computerroomId") Integer computerroomId);

	public int insertrepairlist(Repairlist r);

	public int updateRId(Repairlist repairlist);

	public int delRId(@Param("id") int id);

	public List<RepairlistQuery> selRepairlistQueryFaultName(@Param("form") int form, @Param("pageSize") int pageSize,
			@Param("computerId") int computerId, @Param("computerroomId") int computerroomId);

	public int selRepairlistQueryFaultNameCount(@Param("computerId") int computerId,
			@Param("computerroomId") int computerroomId);

	public List<RepairlistQuery> selRepairlistQuery(@Param("form") int form, @Param("pageSize") int pageSize,
			@Param("computerroomId") int computerroomId);

	public int selRepairlistCount();

	public int selRepairlistComputerroomIdCount(@Param("computerroomId") Integer computerroomId);

	// 10.5
	public List<RepairCountQuery> selectCountByFaultId(@Param("computerroomId") Integer computerroomId,
			@Param("faultId") Integer faultId, @Param("statusId") Integer statuId,
			@Param("beginFaultTime") String beginFaultTime, @Param("endFaultTime") String endFaultTime,
			@Param("classroomId") Integer classroomId);
	
	
	//10.17
	public List<RepairCountQuery> selectCountByFaultId4(@Param("computerroomId") Integer computerroomId,
			@Param("faultId") Integer faultId, @Param("statusId") Integer statuId,
			@Param("beginFaultTime") String beginFaultTime, @Param("endFaultTime") String endFaultTime,
			@Param("classroomId") Integer classroomId);

	public List<RepairCountQuery> selectCountByFaultIdAndClassId(@Param("faultId") Integer faultId,
			@Param("statusId") Integer statuId, @Param("beginFaultTime") String beginFaultTime,
			@Param("endFaultTime") String endFaultTime, @Param("classroomId") String classroomId);

	public int selectComputerRoomFaultCountByComputrtroomId(@Param("computerroomId") int computerroomId,
			@Param("statusId") int statusId);

	public List<RepairlistQuery> selectOneComputerStatusByCId(@Param("computerId") int computerId,
			@Param("computerroomId") int computerroomId);

	public List<RepairlistQuery> selectroomStatusByroomId(@Param("computerroomId") int computerroomId);

	// 查询是否已经有此损坏
	public Integer selRepairlistIsOne(@Param("faultId") Integer faultId,
			@Param("computerroomId") Integer computerroomId, @Param("computerId") Integer computerId);

}
